Skip to content

Fix tile images linking to themselves instead of their pages - #1513

Open
deepusnath wants to merge 2 commits into
openedx:mainfrom
deepusnath:fix/tile-image-links
Open

Fix tile images linking to themselves instead of their pages#1513
deepusnath wants to merge 2 commits into
openedx:mainfrom
deepusnath:fix/tile-image-links

Conversation

@deepusnath

Copy link
Copy Markdown

Sphinx's html_scaled_image_link defaults to True, which auto-wraps any image using :height:, :width:, or :scale: in a link to its own unscaled file. The homepage role-guide tiles use :height: purely for layout, so clicking a tile image opened the raw PNG instead of navigating to the linked page (fixes #1479).

Sphinx's html_scaled_image_link defaults to True, which auto-wraps
any image using :height:, :width:, or :scale: in a link to its own
unscaled file. The homepage role-guide tiles use :height: purely for
layout, so clicking a tile image opened the raw PNG instead of
navigating to the linked page (fixes openedx#1479).
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @deepusnath!

This repository is currently maintained by @openedx/wg-maintenance-docs.openedx.org.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Submit a signed contributor agreement (CLA)

⚠️ We ask all contributors to the Open edX project to submit a signed contributor agreement or indicate their institutional affiliation.
Please see the CONTRIBUTING file for more information.

If you've signed an agreement in the past, you may need to re-sign.
See The New Home of the Open edX Codebase for details.

Once you've signed the CLA, please allow 1 business day for it to be processed.
After this time, you can re-run the CLA check by adding a comment below that you have signed it.
If the CLA check continues to fail, you can tag the @openedx/cla-problems team in a comment for further assistance.

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 18, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Aug 18, 2026
Comment thread source/conf.py Outdated
# `:height:`, `:width:`, or `:scale:` option) to their own unscaled file.
# Our role-guide tiles use `:height:` purely for layout, so this made
# clicking a tile image open the raw image instead of the linked page.
html_scaled_image_link = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the clicking the tile linking to a raw image issue, but doesn't actually fix the problem of the homepage images linking to the page (now clicking the image just does nothing; see https://docsopenedxorg--1513.org.readthedocs.build/en/1513/)

I also don't actually think we want this, though. There are plenty of images within docs pages that have text that's a bit hard to see when you are looking at the docs page, and being able to click on the image to enlarge it is really helpful.

Do you think there's a way to fix, very specifically, the images on the homepage linking to the pages - so here,

Image

clicking on the image would link to the "Educator's Home", without destroying the ability to enlarge other site images?

@sarina sarina moved this from Needs Triage to Needs Tests Run or CLA Signed in Contributions Aug 18, 2026
Replaces the previous approach, which set html_scaled_image_link = False
site-wide. That stopped the tile images from opening the raw PNG, but it
also removed click-to-enlarge from every scaled image in the docs, and
left the tiles inert rather than linking anywhere.

Instead, give each homepage grid-item-card a 🔗/:link-type: option.
sphinx-design renders that as an sd-stretched-link overlay covering the
whole card, so clicking anywhere on a tile -- image included -- navigates
to that role's home page. Scaled images elsewhere keep their default
link to the full-size file.

Verified in a browser against a full site build: clicking each of the
seven tile images navigates to its target page, and a scaled screenshot
on a docs page still links to the image for enlarging.
@deepusnath

Copy link
Copy Markdown
Author

Good catch on both counts — you're right that click-to-enlarge is worth keeping, and that the tiles were left inert rather than actually linking. I've reverted the conf.py change entirely and taken the scoped approach instead.

Each homepage grid-item-card now gets 🔗 / :link-type: doc, which sphinx-design renders as an sd-stretched-link overlay spanning the whole card. Clicking anywhere on a tile — image included — navigates to that role's home page, and image link behavior everywhere else in the docs is untouched.

Verified in a browser against a full site build:

All 7 tile images (6 role guides + Core Contributors Handbook) navigate to their target pages.
The existing footer buttons and card titles still work.
A scaled screenshot on a docs page (manage_course_outline) still renders as , so enlarging is preserved.

One thing worth flagging for your judgment: I applied this to the seven cards that have a single unambiguous destination. I deliberately left the "What's New?", "Quick Starts", "Release Notes", and "Help & Feedback" cards alone, since those contain multiple links or a toctree and a whole-card link would swallow the individual ones. Happy to adjust if you'd rather handle those differently.

@sarina

sarina commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Hi @deepusnath - the language of this comment strongly suggests to me that you're running this code, and my human code review, through an LLM and simply pasting its output. Please review our AI Contribution Policy: https://github.com/openedx/.github/blob/master/AI_POLICY.md and please disclose where you are using AI, and how you are ensuring that human eyes remain in the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Tests Run or CLA Signed

Development

Successfully merging this pull request may close these issues.

Clicking on tile images should bring you to the page, not the image

4 participants